import java.util.Scanner;

public class kaoshi1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        int zf = 0;
        int num = 0;
        for (int i = 0; i < str.length(); i++) {
            char c=str.charAt(i);
            if(c>='A'&&c<='Z'){
                zf++;
            }else if(c>='0'&&c<='9'){
                num++;
            }

        }
        System.out.println("字符出现的次数:"+zf);
        System.out.println("数字出现的次数:"+num);
    }

}
